package com.ticket.service.impl;

import com.ticket.dao.SearchDao;
import com.ticket.entity.Search;
import com.ticket.service.SearchService;
import com.ticket.util.MybatisUtil;
import com.ticket.util.Page;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author 全谢民
 * @version 8.0
 * @description: TODO
 * @date 2023/10/14 20:18
 */
public class SearchServiceImpl implements SearchService {
    static SearchDao sd;
    static {
        SqlSession sqlSession = MybatisUtil.getSqlSession();
        sd = sqlSession.getMapper(SearchDao.class);
    }
    @Override
    public Page<Search> selViewSearchList(Search search, Page<Search> page) {
        List<Search> dataList = sd.selViewSearchList(search,page);
        int count = sd.selViewSearchListCount(search);
        page.setTotalCount(count);
        page.setDataList(dataList);
        return page;
    }


    /*
     * @author 全谢民
     * @description TODO    搜索页面用户可能喜欢
     * @date 2023/10/15 13:59
     */
    @Override
    public List<Search> selLoverList(Search search){
        return  sd.selLoverList(search);
    }
}
